// ProjectManager.h: interface for the ProjectManager class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_PROJECTMANAGER_H__1E73A9A2_E00A_4BB0_9606_9A5540A92241__INCLUDED_)
#define AFX_PROJECTMANAGER_H__1E73A9A2_E00A_4BB0_9606_9A5540A92241__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "ManagerTemplate.h"
#include "Project.h"
#include "Singleton.h"

class DllExport ProjectManager : public ManagerTemplate<CString, Project>
{
	DECLARE_SINGLETON(ProjectManager)

public:
	ProjectManager();
	virtual ~ProjectManager();

public:
	Project* NewProject();
	Project* CurProject();
	Project* GetProject(const CString& strPrj);
	void SetCurProject(const CString& strPrj);
	void SetCurProject(Project* pPrj);
	Project* OpenProject();
	BOOL CloseCurProject();

private:
	void InitVolumeManager();
	BOOL SaveCurPrjBeforeNewPrj();
	void ClosePrj(Project* pPrj);
	Project* RemoveCurPrj();

public:
	Project* m_pCurPrj;
};

DllExport ProjectManager& GetProjectManager();
#endif // !defined(AFX_PROJECTMANAGER_H__1E73A9A2_E00A_4BB0_9606_9A5540A92241__INCLUDED_)
